home *** CD-ROM | disk | FTP | other *** search
/ Technotools / Technotools (Chestnut CD-ROM)(1993).ISO / lang_c / cug172 / lex.h < prev    next >
C/C++ Source or Header  |  1986-02-05  |  3KB  |  69 lines

  1. /*
  2.   HEADER: CUG     nnn.nn;
  3.   TITLE:     LEX - A Lexical Analyser Generator
  4.   VERSION:     1.0 for IBM-PC
  5.   DATE:      Jan 30, 1985
  6.   DESCRIPTION:     A Lexical Analyser Generator. From UNIX
  7.   KEYWORDS:     Lexical Analyser Generator YACC C PREP
  8.   SYSTEM:     IBM-PC and Compatiables
  9.   FILENAME:      LEX.H
  10.   WARNINGS:     This program is not for the casual user. It will
  11.          be useful primarily to expert developers.
  12.   CRC:         N/A
  13.   SEE-ALSO:     YACC and PREP
  14.   AUTHORS:     Scott Guthery 11100 leafwood lane Austin, TX 78750
  15.   COMPILERS:     DESMET-C
  16.   REFERENCES:     UNIX Systems Manuals
  17. */
  18. /*
  19.  * Bob Denny 28-Aug-82  Remove reference to FILE *lexin to
  20.  *                         eliminate dependency on standard I/O library. Only
  21.  *                         lexgetc() used it, and it's there now.
  22.  *                        Add EOF    definition for standalone uses.
  23.  *                        Corrected comment for llnxtmax.
  24.  *
  25.  * Scott Guthery 20-Nov-83    Adapt for IBM PC & DeSmet C.  Removed
  26.  *                            equivalence of yylval and lexval since
  27.  *                            a multi-typed parser wants yylval to be
  28.  *                            typed to be the union of the types (YYSTYPE).
  29.  */
  30.  
  31. /*
  32.  * lex library header file -- accessed through
  33.  *      #include <lex.h>
  34.  */
  35.  
  36. #include <stdio.h>
  37.  
  38. /*
  39.  * Description of scanning tables. The entries at the front of
  40.  * the struct must remain in place for the assembler routines to find.
  41.  */
  42. struct  lextab {
  43.         int     llendst;                /* Last state number            */
  44.         char    *lldefault;             /* Default state table          */
  45.         char    *llnext;                /* Next state table             */
  46.         char    *llcheck;               /* Check table                  */
  47.         int     *llbase;                /* Base table                   */
  48.         int     llnxtmax;               /* Last in next table           */
  49.         int     (*llmove)();            /* Move between states          */
  50.         int     *llfinal;               /* Final state descriptions     */
  51.         int     (*llactr)();            /* Action routine               */
  52.         int     *lllook;                /* Look ahead vector if != NULL */
  53.         char    *llign;                 /* Ignore char vec if != NULL   */
  54.         char    *llbrk;                 /* Break char vec if != NULL    */
  55.         char    *llill;                 /* Illegal char vec if != NULL  */
  56. };
  57.  
  58. #define NBPW         16
  59. #define LEXERR        256
  60. #define LEXSKIP        (-1)
  61. #define EOF            (-1)
  62. #define NULL         (0)
  63. #define LEXECHO(fp) {lexecho((fp));}
  64.  
  65. #define lextext llbuf
  66. #define lexlast llend
  67.  
  68. extern FILE lexin;
  69.